package jbase.project.system.core.defaults;

import jbase.project.system.core.common.EventHook;

public abstract class CascadeEventHook implements EventHook {

	private EventHook parent = null;

	public CascadeEventHook(EventHook parent) {
		this.parent = parent;
	}

	public CascadeEventHook() {
		super();
	}

	@SuppressWarnings("unchecked")
	@Override
	public <T, R> R event(String event, T... objects) {
		if (this.parent != null) {
			return parent.event(event, objects);
		} else {
			return (R) null;
		}
	}

}
